package com.jiyici;

import android.app.Activity;
import android.text.Html;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class ViewUtil {

    public static CharSequence getTitle(CharSequence title) {
        return Html.fromHtml("<font color='#dddddd'>" + title + "</font>");
    }

    public static void hideKeyboard(Activity activity) {
        View view = activity.getWindow().peekDecorView();
        if (view != null) {
            InputMethodManager inputmanger = (InputMethodManager) activity
                    .getSystemService(Activity.INPUT_METHOD_SERVICE);
            inputmanger.hideSoftInputFromWindow(view.getWindowToken(), 0);
        }
    }
}
